<template>
  <footer class="bilibili-footer">
    <div class="footer-container">
      <div class="footer-links">
        <div class="footer-column">
          <h3>视界无界</h3>
          <ul>
            <li><router-link to="/join-contact">关于我们</router-link></li>
            <li><router-link to="/join-contact">联系我们</router-link></li>
            <li><router-link to="/join-contact">加入我们</router-link></li>
            <li><router-link to="/join-contact">友情链接</router-link></li>
          </ul>
        </div>
        <div class="footer-column">
          <h3>客服中心</h3>
          <ul>
            <li><router-link to="/help">帮助中心</router-link></li>
            <li><router-link to="/help?tab=settings">正版认证</router-link></li>
            <li><router-link to="/help?tab=copyright">侵权投诉</router-link></li>
            <li><router-link to="/help?tab=feedback">内容反馈</router-link></li>
          </ul>
        </div>
        <div class="footer-column">
          <h3>增值服务</h3>
          <ul>
            <li><router-link to="/vip">大会员</router-link></li>
            <li><router-link to="/study">课堂</router-link></li>
            <li><router-link to="/comic">漫画</router-link></li>
            <li><router-link to="/periphery">周边商城</router-link></li>
          </ul>
        </div>
        <div class="footer-column">
          <h3>移动端</h3>
          <div class="app-download" @click="showAppDownloadQR">
            <img src="data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2280%22%20height%3D%2280%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20style%3D%22background%3A%23FB7299%3Bborder-radius%3A8px%22%3E%3Ctext%20x%3D%2250%25%22%20y%3D%2250%25%22%20dy%3D%220.3em%22%20text-anchor%3D%22middle%22%20fill%3D%22%23FFFFFF%22%20font-size%3D%2228%22%20font-weight%3D%22bold%22%3EAPP%3C%2Ftext%3E%3C%2Fsvg%3E" alt="扫码下载" style="cursor: pointer;">
            <span style="cursor: pointer;">扫码下载APP</span>
          </div>
          <!-- APP下载二维码弹窗 -->
          <QrCodeModal v-if="showQRCode" @close="showQRCode = false" />
        </div>
      </div>
      <div class="footer-copyright">
        <p>本站视频内容均来自互联网分享站点，本站只提供web页面服务，不提供视频资源存储，也不参与录制与上传</p>
        <p>Copyright © 2009-2024 视界无界  版权所有</p>
      </div>
    </div>
  </footer>
</template>

<script>
import QrCodeModal from './QrCodeModal.vue'

export default {
  name: 'AppFooter',
  components: {
    QrCodeModal,
  },
  data() {
    return {
      showQRCode: false,
    }
  },
  methods: {
    showAppDownloadQR() {
      this.showQRCode = true
    },
  },
}
</script>

<style scoped>
/* 页脚样式优化 */
.bilibili-footer {
  background-color: var(--background-primary, #18181b);
  color: var(--text-secondary, #a1a1aa);
  padding: 40px 0;
  border-top: 1px solid var(--border-light, #3f3f46);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-bottom: 40px;
}

.footer-column {
  flex: 1;
  min-width: 200px;
  margin-bottom: 20px;
}

.footer-column h3 {
  color: var(--text-primary, #f4f4f5);
  font-size: 18px;
  margin-bottom: 16px;
  font-weight: 600;
}

.footer-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-column li {
  margin-bottom: 12px;
}

.footer-column a,
.footer-column router-link {
  color: var(--text-secondary, #a1a1aa);
  text-decoration: none;
  transition: var(--transition-base, all 0.3s ease);
  display: inline-block;
  position: relative;
  padding-bottom: 2px;
}

.footer-column a:hover,
.footer-column router-link:hover {
  color: var(--primary-color, #00a1d6);
  transform: translateX(3px);
}

.footer-column a::after,
.footer-column router-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background-color: var(--primary-color, #00a1d6);
  transition: var(--transition-base, all 0.3s ease);
}

.footer-column a:hover::after,
.footer-column router-link:hover::after {
  width: 100%;
}

.app-download {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: var(--transition-base, all 0.3s ease);
}

.app-download:hover {
  transform: scale(1.05);
}

.app-download img {
  border-radius: 8px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-medium, 0 4px 6px rgba(0, 0, 0, 0.1));
  transition: var(--transition-base, all 0.3s ease);
}

.app-download:hover img {
  box-shadow: var(--shadow-large, 0 10px 15px rgba(0, 0, 0, 0.1));
}

.footer-copyright {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--border-light, #3f3f46);
  font-size: 14px;
  line-height: 1.6;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .footer-links {
    flex-direction: column;
    align-items: center;
  }
  
  .footer-column {
    text-align: center;
    margin-bottom: 30px;
  }
  
  .footer-copyright p {
    font-size: 12px;
    padding: 0 10px;
  }
}

@media (max-width: 992px) {
  .footer-links {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .footer-links {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}
</style>